package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	import flash.events.Event;
	import flash.events.TextEvent;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	
	import kr.flas.automaton.HangulAutomaton;
	
	/**
	 * 라이브러리 테스트를 위한 메인 클래스
	 */
	public class FLASLibrary extends Sprite
	{
		protected var _automaton:HangulAutomaton; 
		
		public function FLASLibrary()
		{
			var txt:TextField = new TextField();
			txt.width = 150;
			txt.height = 20;
			txt.border = true;
			txt.type = TextFieldType.INPUT;
			addChild(txt);
			
			_automaton = new HangulAutomaton();
			
			txt.addEventListener(TextEvent.TEXT_INPUT, _automaton.onTextInput);
			txt.addEventListener(Event.CHANGE, _automaton.onChange);
			txt.addEventListener(KeyboardEvent.KEY_UP, _automaton.onKeyboard);
			txt.addEventListener(KeyboardEvent.KEY_DOWN, _automaton.onKeyboard);
			txt.addEventListener(MouseEvent.CLICK, _automaton.onMouse);
		}
	}
}